package com.oreilly.ez.service;

import com.oreilly.ez.base.ExcelColumnAdaptor;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

@Service
public class DateAdaptor implements ExcelColumnAdaptor<Date> {

    @Override
    public String val(Date date) {
        if(date == null){
            return "";
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return sdf.format(date);
    }

    @Override
    public Date parse(String val) {
        return null;
    }
}
